package com.zuipin.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zuipin.entity.product.CatgroyProperties;
import com.zuipin.mapper.CategroyPropertiesMapper;
import com.zuipin.service.ICategroyPropertiesService;

@Service
public class CatgroyPropertiesServiceImpl implements ICategroyPropertiesService {
	
	@Resource
	private CategroyPropertiesMapper catgroyPropertiesMapper;
	
	@Override
	public int insertSelective(CatgroyProperties record) {
		// TODO Auto-generated method stub
		return catgroyPropertiesMapper.insertSelective(record);
	}
	
	@Override
	public int updateByPrimaryKeySelective(CatgroyProperties record) {
		// TODO Auto-generated method stub
		return catgroyPropertiesMapper.updateByPrimaryKeySelective(record);
	}
	
	@Override
	public Boolean isUseInCateProp(Long propId) {
		CatgroyProperties search = new CatgroyProperties();
		search.setPropId(propId);
		List<CatgroyProperties> list = catgroyPropertiesMapper.selectBySelective(search);
		
		if (list == null || list.isEmpty()) {
			return false;
		}
		return true;
		
	}
	
	@Override
	public List<CatgroyProperties> selectBySelective(CatgroyProperties record) {
		// TODO Auto-generated method stub
		return catgroyPropertiesMapper.selectBySelective(record);
	}
	
}
